package servlet;

import dao.StudentDao;
import vo.Student;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * Created by ssw on 2018/6/19.
 */
public class AskAllStudentsServlet extends HttpServlet{
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        StudentDao studentDao =new StudentDao();
        List<Student> studentList= studentDao.askAllStudentList();
        req.setAttribute("stuList", studentList);
        req.getRequestDispatcher("sgms/admin_seeStudents.jsp").forward(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }
}
